package com.crm.system.service.csd.customerManager;

import com.alibaba.fastjson.JSONObject;
import com.crm.common.model.DhPageInfo;
import com.crm.model.entity.csd.customerManager.*;
import com.crm.model.entity.customerManager.CustomerProductDetailMemberCard;
import com.crm.model.entity.finishOrderProduct.FinishOrderProduct;
import com.crm.model.qo.csd.customerManager.CustomerInfoQO;
import com.crm.model.qo.csd.customerManager.CustomerQO;
import com.crm.model.qo.csd.customerManager.CustomerUpdateQO;
import com.crm.model.vo.csd.customerManager.*;

import java.util.List;

/**
 * @author yincuimei
 * @Date 2021/7/23 11:25
 * (客服部)-客户管理
 */
public interface CustomerService {

    /**
     * 客户列表
     * @param customerQO --查询条件
     * @param pageIndex  --页码
     * @param pageSize   --分页大小
     * @param sortName   --排序字段
     * @param sortOrder  --排序规则
     * @author yincuimei
     * @return
     */
    DhPageInfo<CustomerVO> selectCustomerVOList(CustomerQO customerQO, Integer pageIndex, Integer pageSize, String sortName, String sortOrder);


    /**
     * 会员客户列表
     * @param customerQO --查询条件
     * @param pageIndex  --页码
     * @param pageSize   --分页大小
     * @param sortName   --排序字段
     * @param sortOrder  --排序规则
     * @author wangpeng
     * @return
     */
    DhPageInfo<CustomerVO> selectCustomerMemberList(CustomerQO customerQO, Integer pageIndex, Integer pageSize, String sortName, String sortOrder);


    /**
     * 非会员客户列表
     * @param customerQO --查询条件
     * @param pageIndex  --页码
     * @param pageSize   --分页大小
     * @param sortName   --排序字段
     * @param sortOrder  --排序规则
     * @author wangpeng
     * @return
     */
    DhPageInfo<CustomerVO> selectCustomerNonMemberList(CustomerQO customerQO, Integer pageIndex, Integer pageSize, String sortName, String sortOrder);


    /**
     * 客户详情(企业客户)
     * @param customerId --客户ID
     * @author yincuimei
     * @return
     */
    CustomerDetailVO selectCustomerDetailVO(String customerId);

    /**
     * 客户编辑(企业客户)
     * @param customerUpdateQO
     * @author yincuimei
     * @return
     */
    Boolean updateCustomerByCustomerId(CustomerUpdateQO customerUpdateQO);


    /**
     * (客服部)客户列表--操作解锁--锁定
     * @param customerId 客户ID
     * @param remarks  备注
     * @param customerName 客户名称
     * @author wangpeng
     * @return
     */
    Boolean updateCustomerMembershipLevelUnlock(String customerId,String remarks,String customerName);

    /**
     * (客服部)客户列表--操作解锁--锁定
     * @param customerId 客户ID
     * @param remarks  备注
     * @param customerName 客户名称
     * @author wangpeng
     * @return
     */
    Boolean updateCustomerMembershipLevelLocking(String customerId,String remarks,String customerName);

    /**
     * 会员卡详情
     * @param customerProductDetailMemberCardId 会员卡id
     * @return
     */
    CustomerMemberCardDetailVO selectCustomerCardDetail(String customerProductDetailMemberCardId, String memberCardNumber);

    /**
     * 客户详情-会员卡详情
     * @param customerProductDetailMemberCardId 会员卡id
     * @param memberCardNumber 会员卡号
     * @author baijian
     * @return
     */
    void customerCardDetail(String customerProductDetailMemberCardId, String memberCardNumber);

    /**
     * 客户详情-会员卡详情-修改合同的联系人姓名和联系方式
     * @param contractId 合同id
     * @author yincuimei
     * @return
     */
    Boolean updateContractNameAndPhone(String customerProductDetailMemberCardId,String contractId,String contactName,String contactDetails,String startTm,String endTm);

    /**
     * 会员卡电话答疑拨打记录
     * @param customerProductDetailMemberCardId 会员卡id
     * @return
     */
    DhPageInfo<CustomerMemberCardDetailPhoneAnsweringRecord> answerList(Integer pageIndex, Integer pageSize, String sortName, String sortOrder, String customerProductDetailMemberCardId);

    /**
     * 会员卡视频观看记录
     * @param customerProductDetailMemberCardId 会员卡id
     * @return
     */
    DhPageInfo<CustomerMemberCardDetailVideoViewingRecord> videoList(Integer pageIndex, Integer pageSize, String sortName, String sortOrder, String customerProductDetailMemberCardId);

    /**
     * 会员卡直播报名预约
     * @param customerProductDetailMemberCardId 会员卡id
     * @return
     */
    DhPageInfo<CustomerMemberCardDetailLiveSignatureAppointment> appointmentList(Integer pageIndex, Integer pageSize, String sortName, String sortOrder, String customerProductDetailMemberCardId);

    /**
     * 会员卡服务明细
     * @param customerProductDetailMemberCardId 会员卡id
     * @return
     */
    MemberCardDetailVO customerMemberCardDetail(String customerProductDetailMemberCardId);

    /**
     * 会员卡刷卡记录
     * @param customerProductDetailMemberCardId 会员卡id
     * @return
     */
    DhPageInfo<CustomerMemberCardDetailSwipingRecord> swipingList(Integer pageIndex, Integer pageSize, String sortName, String sortOrder, String customerProductDetailMemberCardId);

    /**
     * 会员卡直播购买记录
     * @param customerProductDetailMemberCardId 会员卡id
     * @return
     */
    DhPageInfo<CustomerMemberCardDetailLivePurchaseRecord> purchaseList(Integer pageIndex, Integer pageSize, String sortName, String sortOrder, String customerProductDetailMemberCardId);

    /**
     * 会员卡点播购买记录
     * @param customerProductDetailMemberCardId 会员卡id
     * @return
     */
    DhPageInfo<CustomerMemberCardDetailDemandPurchaseRecord> demandList(Integer pageIndex, Integer pageSize, String sortName, String sortOrder, String customerProductDetailMemberCardId);

    /**
     * 客户详情-会员卡详情-修改会员卡服务明细
     * @param customerMemberCardDetail 服务明细
     * @author yincuimei
     * @return
     */
    Boolean updateCustomerMemberCardDetail(MemberCardDetailVO customerMemberCardDetail);

    /**
     * (客服部)客户列表--客户详情-会员卡信息-作废会员卡
     * @param customerProductDetailMemberCard 会员卡
     * @author yincuimei
     * @return
     */
    Boolean updateCustomerProductDetailMemberCard(CustomerProductDetailMemberCard customerProductDetailMemberCard);

    /**
     * (客服部)客户列表--客户详情-产品信息-修改产品
     * @param finishOrderProduct 产品
     * @author yincuimei
     * @return
     */
    Boolean updateFinishOrderProduct(FinishOrderProduct finishOrderProduct,String logRemark);

    /**
     * selectCustomerInfoList
     * @Author wangpeng
     * @Date 2021/9/27
     * @param customerQO
     * @param pageIndex
     * @param pageSize
     * @param sortName
     * @param sortOrder
     * @return
     */
    DhPageInfo<CustomerInfoVO> selectCustomerInfoList(CustomerInfoQO customerQO, Integer pageIndex, Integer pageSize, String sortName, String sortOrder);

    /**
     * uploadExcel
     * @Author wangpeng
     * @Date 2021/10/12
     * @return
     */
    JSONObject uploadExcel(List<ImportCustomerInfoVO> list);

    /**
     * exportExcel
     * @Author wangpeng
     * @Date 2021/10/12
     * @param 	
     * @return
     */
    List<ImportCustomerInfoVO> exportExcel();

    /**
     * 新增
     * @param customerInfoQO
     * @return
     */
    boolean addCustomerInfo(CustomerInfoQO customerInfoQO);

    List<CustomerInfoVO> selectProviceList();

    List<CustomerInfoVO> selectCityByProvice(String provice);

    List<CustomerInfoVO> selectDistrictByProviceCity(String provice, String city);

    List<CustomerInfoVO> selectIndustryTypeList();

    /**
     * 根据客户信息库ID获取详情
     * @param customerInfoId
     * @return
     */
    CustomerInfo getCustomerInfoDetailByCustomerInfoId(String customerInfoId);

    /**
     * 【客服部】客户信息库列表-详细-调整
     * @param customerInfoId --主键
     * @param companyId      --所属分公司
     * @param accountId      --所有人
     * @author yincuimei(2021-12-24)
     * @return
     */
    Boolean updateCompanyAndAccountById(String customerInfoId,String companyId,String accountId);
}
